
	package com.edu.service;
	
	import java.util.Arrays;
import java.util.List;
	
	import com.edu.dao.BaseDao;
	import com.edu.dao.BaseDaoImpl;
	import com.edu.entity.Student;
	
	public class Service implements ServiceDao{
		public List<Student> getMess() {
			BaseDao bs=new BaseDao();
			List<Student> stu=bs.queryAll();
			return stu;
			
		}
		public void deleteStu(int uid) {
			BaseDaoImpl bs=new BaseDaoImpl();
			int result=bs.setSql(uid);
		    if(result==1) {
		    	System.out.println("删除成功");
	    }else {
	    	System.out.println("删除失败");
	    }
		
		
	}
	@Override
	public void doResult(Student stu) {
		// TODO Auto-generated method stub
		BaseDaoImpl bs=new BaseDaoImpl();
		int result=bs.setUpdateSql(stu);
	    if(result==1) {
	    	System.out.println("成功");
	    }else {
	    	System.out.println("失败");
		    }
		}
	@Override
	public void doDeleteAll(String[] ids) {
		// TODO Auto-generated method stub
		String str=Arrays.toString(ids);
		str=str.substring(1,str.length()-1);
		BaseDaoImpl bs=new BaseDaoImpl();
		int result=bs.deleteByIds(str);
		if(result>0) {
	    	System.out.println("成功");
	    }else {
	    	System.out.println("失败");
	    }
	}
		
	
}
		
			



